package com.foreknow.springboot_demo.service.Impl;

import com.foreknow.springboot_demo.mapper.CartMapper;
import com.foreknow.springboot_demo.po.Cart;
import com.foreknow.springboot_demo.po.Orders;
import com.foreknow.springboot_demo.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl implements CartService {
    @Autowired
    private CartMapper cartMapper;

    @Override
    public List<Cart> listCart(String userId, Integer businessId) {
        return cartMapper.listCart(userId,businessId);
    }

    @Override
    public Integer saveCart(String userId, int foodId, int businessId) {
        return cartMapper.saveCart(userId,foodId,businessId);
    }

    @Override
    public Integer updateCart(String userId, int foodId, int businessId, int quantity) {
        return cartMapper.updateCart(userId,foodId,businessId,quantity);
    }

    @Override
    public Integer removeCart(String userId, Integer foodId, Integer businessId) {
        return cartMapper.removeCart(userId,foodId,businessId);
    }
}
